package com.ruoyi.yijing.service.impl;

import java.util.Date;
import java.util.List;

import com.ruoyi.common.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.yijing.mapper.YjGuaiCategoryMapper;
import com.ruoyi.yijing.domain.YjGuaCategory;
import com.ruoyi.yijing.service.IYjGuaiCategoryService;

/**
 * 卦和占卜问题的关系Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-01-22
 */
@Service
public class YjGuaiCategoryServiceImpl implements IYjGuaiCategoryService 
{
    @Autowired
    private YjGuaiCategoryMapper yjGuaiCategoryMapper;

    /**
     * 查询卦和占卜问题的关系
     * 
     * @param yxId 卦和占卜问题的关系主键
     * @return 卦和占卜问题的关系
     */
    @Override
    public YjGuaCategory selectYjGuaiCategoryByYxId(Long yxId)
    {
        return yjGuaiCategoryMapper.selectYjGuaiCategoryByYxId(yxId);
    }

    /**
     * 查询卦和占卜问题的关系列表
     * 
     * @param yjGuaiCategory 卦和占卜问题的关系
     * @return 卦和占卜问题的关系
     */
    @Override
    public List<YjGuaCategory> selectYjGuaiCategoryList(YjGuaCategory yjGuaiCategory)
    {
        return yjGuaiCategoryMapper.selectYjGuaiCategoryList(yjGuaiCategory);
    }

    /**
     * 新增卦和占卜问题的关系
     * 
     * @param yjGuaiCategory 卦和占卜问题的关系
     * @return 结果
     */
    @Override
    public int insertYjGuaiCategory(YjGuaCategory yjGuaiCategory)
    {
        yjGuaiCategory.setCreateBy(SecurityUtils.getUsername());
        yjGuaiCategory.setCreateTime(new Date());
        return yjGuaiCategoryMapper.insertYjGuaiCategory(yjGuaiCategory);
    }

    /**
     * 修改卦和占卜问题的关系
     * 
     * @param yjGuaiCategory 卦和占卜问题的关系
     * @return 结果
     */
    @Override
    public int updateYjGuaiCategory(YjGuaCategory yjGuaiCategory)
    {
        yjGuaiCategory.setUpdateBy(SecurityUtils.getUsername());
        yjGuaiCategory.setUpdateTime(new Date());
        return yjGuaiCategoryMapper.updateYjGuaiCategory(yjGuaiCategory);
    }

    /**
     * 批量删除卦和占卜问题的关系
     * 
     * @param yxIds 需要删除的卦和占卜问题的关系主键
     * @return 结果
     */
    @Override
    public int deleteYjGuaiCategoryByYxIds(Long[] yxIds)
    {
        return yjGuaiCategoryMapper.deleteYjGuaiCategoryByYxIds(yxIds);
    }

    /**
     * 删除卦和占卜问题的关系信息
     * 
     * @param yxId 卦和占卜问题的关系主键
     * @return 结果
     */
    @Override
    public int deleteYjGuaiCategoryByYxId(Long yxId)
    {
        return yjGuaiCategoryMapper.deleteYjGuaiCategoryByYxId(yxId);
    }
}
